package com.ityunhe.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.ityunhe.bean.Orders;
import com.ityunhe.dao.OrdersDao;
import com.ityunhe.factory.MybatisUtil;

public class OrdersDaoImpl implements OrdersDao {
	SqlSession session =null;
	@Override
	public int saveOrders(Orders order) {
		int saveOrderDao=0;
		try {
		 session = MybatisUtil.getSession();
		OrdersDao mapper = session.getMapper(OrdersDao.class);
		saveOrderDao = mapper.saveOrders(order);
			session.commit();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally{
			MybatisUtil.closeSession();
		}
		return saveOrderDao;
	}

	@Override
	public int remove(Orders order) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(Orders order) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Orders getOrders(Orders order) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Orders> listOrders() {
		// TODO Auto-generated method stub
		return null;
	}

}
